package cn.itcast.service.impl;

import cn.itcast.dao.AccountDao;
import cn.itcast.domain.Account;
import cn.itcast.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountDao accountDao;

    public List<Account> findAll() throws Exception {
        List<Account> all = accountDao.findAll();

        return all;
    }

    public void delete(Integer id) throws Exception {
        accountDao.delete(id);

    }

    public void add(Account account) throws Exception {
        accountDao.add(account);
    }

    public void update(Account account) throws Exception {
        accountDao.update(account);
    }
}
